using System;
using DotNetNuke;
using System.Data;

using DotNetNuke.Framework;

namespace PT.CarList
{
    public abstract class DataProvider
    {

        #region Shared/Static Methods

        // singleton reference to the instantiated object 
        static DataProvider objProvider = null;

        // constructor
        static DataProvider()
        {
            CreateProvider();
        }

        // dynamically create provider
        private static void CreateProvider()
        {
            objProvider = (DataProvider)Reflection.CreateObject("data", "PT.CarList", "");
        }

        // return the provider
        public static DataProvider Instance()
        {
            return objProvider;
        }

        #endregion

        #region Abstract methods

        public abstract IDataReader GetCar(int ItemId);
        public abstract IDataReader GetCarList(int ModuleID);
        public abstract void InsertUpdateCar(int ModuleId, int ItemId, string CarName, string CarManufacture, string CarType, string Price, string ImageURL, string OtherInfo, string DetailInfo, int UserId);
        public abstract void DeleteCar(int ItemId);

        #endregion

    }
}
